home *** CD-ROM | disk | FTP | other *** search
- /*
- * This class contains general policy definitions and operations.
- */
-
- var EXPORTED_SYMBOLS = [ ];
- Components.utils.import("resource://csfiremodules/CsFireCommon.jsm");
-
- CsFire.Policy = new function() {
- this.DISABLED = 0;
- this.ACCEPT = 1;
- this.STRIP = 2
- this.BLOCK = 3;
-
- this.SRC_CLIENT = 0;
- this.SRC_SERVER = 1;
- }
-
-
- /*
- * This function converts the numerical decision representation to a textual value.
- */
- CsFire.Policy.textualDecision = function(decision) {
- var result = "";
-
- if(decision.whitelist) {
- result += "WHITELISTED";
- }
- else {
- switch(decision.source) {
- case this.SRC_CLIENT: result = "CLIENT - ";
- break;
- case this.SRC_SERVER: result = "SERVER - ";
- break;
- }
-
- switch(decision.action) {
- case this.ACCEPT: result += "ACCEPT";
- break;
- case this.STRIP: result += "STRIP";
- if(decision.stripAuth != null && decision.stripAuth == true) {
- result += " (AUTH)";
- }
- if(decision.stripCookies != null && decision.stripCookies == true) {
- result += "(COOKIES"
- if(decision.cookieExceptions != null) {
- result += " [";
- for(cookie in decision.cookieExceptions) {
- result += cookie;
- result += ";";
- }
- result += "]";
- }
- result += ")";
- }
- break;
- case this.BLOCK: result += "BLOCK";
- break;
- case this.DISABLED: result += "DISABLED";
- break;
- }
- }
-
-
-
- return result;
- }
-